const baseUrl ='http://localhost:8888'

const http=({url,data={},method='get'})=>{
	if(!url)return;
	let p=new Promise((resolve, reject)=>{
		uni.request({
			url:baseUrl+url,
			data,
			method,
			success(res) {
				resolve(res)
			},
			fail(err){
				reject(err)
			}
		})
	});
	return p;	
}

export default http;